package sf.model.fields;

import javax.swing.JTextField;

@Deprecated
public class StringField extends JTextField implements Field {

	private static final long serialVersionUID = 1L;

	public StringField(String name, int columns) {
		setName(name);
		setColumns(columns);
	}

	public Object getValue() {
		String text = getText();
		return text.length() > 0 ? text : null;
	}

	public void setValue(Object value) {
		setText((String) value);
	}

	public void clear() {
		setText("");
	}
}
